package inventory.mappers;

import inventory.entity.ReparationRecord;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import inventory.entity.Role;
import inventory.entity.po.ReparationPo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sxt
 * @since 2019-11-06
 */
public interface ReparationRecordMapper extends BaseMapper<ReparationRecord> {



    int insertReparationPo(ReparationPo reparationPo);//插入一条设备报修记录
    Role selectUserRoleByUserId(String userId);//根据用户id查找role
    List<ReparationPo> selectRepairByUserId(String userId);//查看底层员工的报修记录
    List<ReparationPo> selectRepairByCountyUserId(String userId);
    List<ReparationPo> selectRepairByCityUserId(String userId);
    int updateReparationByreparationId(@Param("reparationId") String reparationId,@Param("userId") String userId,@Param("handleProgress")String handleProgress);
    int deleteReparationPoByReparationId(String reparationId);//根据设备id删除设备信息
    //自定义ReparationPo，新增insert
    //新增select
    ReparationPo selectByReparationId(String reparationId);//根据设备id查看信息
    List<ReparationPo> selectByReparationerById(String reparationerId);//根据用户id查看用户的自己报修记录
    List<ReparationPo> selectRecordByReparationerId(String reparationpointer);//根据用户id查看下级的申请报修记录


    Role selectUserPidByReparationerId(String reparationerId);
    Role selectUserPidByRoleId(String roleId);



}
